<template>
    <div id="searchlist">
        <div class="card" >
            <div class="card1" v-for="(item,index) in list" :key="index" @click="details(item)">
                <img :src="item.picUrl" >
                <h4>{{item.name}}</h4>
                <span class="score">星 {{item.wmPoiScore}}</span>
                <span class="sell">{{item.monthSalesTip}}</span><br>
                <span class="money">起送￥20 {{item.shippingFeeTip}}</span>
                <span class="time">{{item.deliveryTimeTip}} {{item.distance}} </span><br>
                <div class="red">
                      <span class="reduce" v-for="(item,index) in item.discounts2" :key="index">{{item.info}}</span>
                </div>
            </div>
        </div>
    </div>
  
</template>

<script>
import { shop_search } from '@/utils/api'
export default {
    mounted(){
        shop_search({searchkey:this.$route.query.searchkey}).then((res)=>{
            this.list=res.data.list;
        })
    },

    data(){
        return{
            list:[],
        }
    },
    methods:{
        details(item){
            this.$router.push('/detail/'+item.mtWmPoiId);
        },
        updata(val){
            shop_search({searchkey:val}).then((res)=>{
                this.list=res.data.list;
            })
        }
    }
}
</script>

<style lang="scss" scoped>
#searchlist .card .card1{
        height: 140px;
        img{
              height: 100px;
              width: 100px;
              float: left;
              margin:5px;
          }
        .score{
              font-size: 12px;
              color: red;
              display: inline-block;
              margin-top: 10px;
          }  
        .sell{
              font-size: 12px;
          }
        .money{
              font-size: 12px;
          }
        .time{
              font-size: 12px;
              float:right;
          }
        .appraise{
              font-size: 12px;
              background-color: rgb(187, 255, 170);
              color: green;
              margin: 5px 2px;
              display: inline-block;
          }
        .red{
            margin-top:10px ;
            height: 22px;
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
                .reduce{
                font-size: 12px;
                border-radius: 5px;
                border: 1px red solid;
                margin: 0 2px;
                color: red;
                padding: 1px;
                
            }
          }
    }
</style>